import { Card } from 'antd';
import SortList from './sortList';
type PropField = {
  title: string;
  datas: API.DeptJfData[];
  height: number;
  itemType: number;
};
const DeptYcPp: React.FC<PropField> = (props) => {
  const itemType = props.itemType;
  const valueField =
    itemType === 1
      ? 'ztZyCurrVal'
      : itemType === 2
      ? 'jxedCurrVal'
      : itemType === 3
      ? 'fyedCurrVal'
      : 'zyHbl';
  return (
    <Card
      size="small"
      title={props.title}
      bodyStyle={{ padding: '8px', height: (props.height - 60) / 2 - 115 }}
      style={{ marginTop: '8px' }}
    >
      <SortList
        format="0.00"
        datas={props.datas}
        nameCol={'dpnm'}
        numCol={valueField}
        pageSize={5}
        interval={5000}
        dCol={'dC'}
      />
    </Card>
  );
};
export default DeptYcPp;
